﻿using System;
namespace ORS.OrderRobot
{
    /// <summary>
    /// 后台作业管理器接口
    /// 提供后台作业的调度、状态查询和删除功能
    /// </summary>
    public interface IBackgroundJobManager
    {
        /// <summary>
        /// 将后台作业添加到队列中执行
        /// </summary>
        /// <typeparam name="TJob"></typeparam>
        /// <typeparam name="TArgs"></typeparam>
        /// <param name="args"></param>
        /// <param name="delayMinute">是否延期</param>
        /// <returns></returns>
        Task EnqueueAsync<TJob, TArgs>(TArgs args,int? delayMinute = null) where TJob : IBackgroundJob<TArgs>;
    }
}

